home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_gen_elevswitch.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  84 lines

  1. # Jones 3D Cog Script
  2. #
  3. # gen_ElevSwitch.cog
  4. #
  5. # This elevator will go up to frame one, sleep, then come back down to frame 0 when
  6. # entered from the bottom.  When entered from the top, it should stay at the bottom.
  7. # The button surface is a call switch you can put at the top to call the thing up there.
  8. # Elevator will react to "blocked" message.
  9. #
  10. # [DS/RD/IS/JS]
  11. # Modified 11/13/96 DS  (added third adjoin)
  12. # Modified 12/14/96 by RKD (changed to new COG format)
  13. # Modified 4/6/97 by IS (Fixed bug with repeatedly hitting switch)
  14. # Modified 4/29/97 by RKD (changed to work with 00_sendmessage.cog -- see commented out line below)
  15. # Modified 4/30/97 by IS (Changed from sleep to timer)
  16. # Modified 8/19/97 by JS (added blocked message)
  17. # Modified 9/1/97 by SXC (took blocked message out)
  18. #
  19. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  20. # ========================================================================================
  21.  
  22. symbols
  23.     message  crossed
  24.     message  activate
  25.     message  arrived
  26.     message  timer
  27.  
  28.     surface  lower_adjoin0  linkid=1
  29.     surface  lower_adjoin1  linkid=1
  30.     surface  lower_adjoin2  linkid=1
  31.     surface  button         linkid=1
  32.  
  33.     thing    elevator       linkid=2
  34.  
  35.     flex     start_wait=0.25   desc=pause_before_moving_up
  36.     flex     sleeptime=2.0
  37.     flex     speed=4.0
  38. #    sound    wav0=Activate02.wav
  39. end
  40.  
  41. # ========================================================================================
  42.  
  43. code
  44. crossed:                // If player crosses adjoin(s)
  45.    Sleep(start_wait);            // pause before moving up
  46.    // fall through
  47.  
  48. # ........................................................................................
  49.  
  50. activate:                 // If player presses button
  51.    if (GetSenderId() != 1) return;  // message came from elevator
  52.    if (GetWallCel(button) == 1) return;
  53.  
  54.    SetWallCel(button, 1);
  55.    // PlaySoundPos(wav0, GetSurfaceCenter(button), 0.6, -1, -1, 0);
  56.  
  57.    MoveToFrame(elevator, 1, speed);
  58.    return;
  59.  
  60. # ........................................................................................
  61.  
  62. arrived:
  63.    if (GetCurFrame(elevator) == 0)
  64.     {
  65.       SetWallCel(button, 0);
  66.       // PlaySoundPos(wav0, GetSurfaceCenter(button), 0.6, -1, -1, 0);
  67.    }
  68.     else
  69.     {
  70.       // Set sleep time at top
  71.       SetTimer(sleeptime);
  72.    }
  73.    return;
  74.  
  75. # ........................................................................................
  76.  
  77. timer:
  78.    // Send elevator down
  79.    MoveToFrame(elevator, 0, speed);
  80.    return;
  81.  
  82. end
  83.  
  84.